//
//  PAAppContext.h
//  PilotSeries
//
//  Created by 黄立强 on 16/6/29.
//  Copyright © 2016年 leon.huang. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, PAEnvironmentType) {
    PAEnvironmentTypeDev = 0,
    PAEnvironmentTypeQA,
    PAEnvironmentTypeProduct,
};

typedef NS_ENUM(NSInteger, PAViewType) {
    PAViewTypeGraph = 0,
    PAViewTypeGrid
};
@protocol  PAWebSocketManagerRangeListDelegete <NSObject>

-(void)webSocketManagerDidReiceveRangeList:(NSArray *)rangeList;

@end

@protocol  PAWebSocketManagerChartConfigListDelegete <NSObject>

-(void)webSocketManagerDidReiceveChartConfigList:(NSArray *)chartConfigList;

@end


@interface PAAppContext : NSObject

@property (assign, nonatomic) PAEnvironmentType envType;


/**  */
@property (copy, nonatomic) NSString *w_host;


/** */
@property (assign, nonatomic) NSUInteger w_port;

/**  */
@property (copy, nonatomic) NSString *chartingview_login_url;


@property (nonatomic, strong) NSArray * rangelists;

/**
 *  从服务端收到的chartconfigs
 */
@property (nonatomic, strong) NSMutableArray * chartConfigs;

@property (nonatomic, strong) NSArray * chartNames;
/**  */
@property (copy, nonatomic) NSString *username;

@property (copy, nonatomic) NSString *token;

@property (copy, nonatomic) NSString *appid;

/** */
@property (assign, nonatomic) int netStatus;

@property (weak, nonatomic) id<PAWebSocketManagerRangeListDelegete> rangelistDelegete;

@property (weak, nonatomic) id<PAWebSocketManagerChartConfigListDelegete> chartConfiglistDelegete;

@property (nonatomic, strong) NSDictionary * metaData;

+ (PAAppContext *)sharedInstance;
/**
 *  处理服务器消息，将收到的chartConfigs 重新整理，同时更新好本地的chartConfig
 *
 *  @param dic
 */
-(void)processData:(NSDictionary *)dic;


@end
